package com.telit.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.telit.common.dto.NormalTaskDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;


/**
 * <p>
 * 事件任务巡护关联表
 * </p>
 *
 * @author yummy
 * @since 2021-07-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value="CommEventTaskTrack对象", description="事件任务巡护关联表")
public class CommEventTaskTrack implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId(type= IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "事件ID")
    private Long eventId;

    @ApiModelProperty(value = "事件类型，1火情任务，2事件任务")
    private String eventType;

    @ApiModelProperty(value = "热点编号集合")
    private String hotPortNumber;

    @ApiModelProperty(value = "所属村编码集合")
    private String countryCode;

    @ApiModelProperty(value = "任务ID")
    private Long taskId;

    @ApiModelProperty(value = "护林员ID")
    private Long forestkeeperId;

    @ApiModelProperty(value = "护林员name")
    private String forestkeeperName;

    @ApiModelProperty(value = "巡护ID")
    private String trackId;

    @ApiModelProperty(value = "巡护类型")
    private String trackType;

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty(value = "经度")
    private String longitude;

    @ApiModelProperty(value = "纬度")
    private String latitude;

    @ApiModelProperty(value = "行政区划代码")
    private String districtCode;

    // 新增详细地址,给指定巡航/巡护任务用
    @ApiModelProperty(value = "指定巡航巡护任务详细地址")
    private String taskDetailAddress;

    public CommEventTaskTrack(NormalTaskDTO normalTaskDTO, Long taskId){
        this.forestkeeperId = normalTaskDTO.getForestkeeperId();
        this.status = normalTaskDTO.getStatus();
        this.taskId = taskId;
        this.trackId = normalTaskDTO.getTrackId();
        this.trackType = normalTaskDTO.getType();
    }
}
